//
//$Id: ode1ivp_sa.h 339 2010-02-28 13:20:14Z Oleg.Bulychov $
#pragma once

#include "projects/ode1ivp/ode1ivp.h"
#include "solvers/sa/sa_common.h"

//__________________________________________________________________________________
template<>
struct solution<ODE1IVP_Solution, sa_tag>:
    public ODE1IVP_Solution
{
public:
    template<class E>
    void move(E* env, uniform_random& rnd, double probability)
    {
        for (size_t i = 1; i <= env->cfg_.n_; ++i)
        {
            if (rnd.next_Double() < probability)
            {
				y_[i] = y_[i] + env->cfg_.eps_ * (1 - 2 * rnd.next_Double()); // old y_[i]-eps_ < new y_[i] < old y_[i]+eps_
                changed_ = true;
            }
        }
    }
};
//__________________________________________________________________________________
//EOF!
